import { createStore } from 'redux'

const initState = {
  username: '',
  password: ''
}

const reducer = (state = initState, aciton) => {
  if(aciton.type === 'saveUserInfo') {
    return {
      username: aciton.payload.username,
      password: aciton.payload.password
    }
  }
  return state
}

export const store = createStore(reducer)

export default store